}
}
+/*
+ * Makes another pass over the data to compute bounding
+ * box data and populates bounding box information.
+ */
+
+void
+waypt_compute_bounds(bounds *bounds)
+{
+ queue *elem, *tmp;
+ waypoint *waypointp;
+
+ /* Set data out of bounds so that even one waypoint will reset */
+ bounds->max_lat = -9999;
+ bounds->max_lon = -9999;
+ bounds->min_lat = 9999;
+ bounds->min_lon = 9999;
+
+ QUEUE_FOR_EACH(&waypt_head, elem, tmp) {
+ waypointp = (waypoint *) elem;
+ if (waypointp->latitude > bounds->max_lat)
+ bounds->max_lat = waypointp->latitude;
+ if (waypointp->longitude > bounds->max_lon)
+ bounds->max_lon = waypointp->longitude;
+ if (waypointp->latitude < bounds->min_lat)
+ bounds->min_lat = waypointp->latitude;
+ if (waypointp->longitude < bounds->min_lon)
+ bounds->min_lon = waypointp->longitude;
+ }
+}
+
waypoint *
find_waypt_by_name(const char *name)
{